package com.chee.plant.hibernate.object.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the cross_plant table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="cross_plant"
 */

public abstract class BaseCrossPlant  implements Serializable {

	public static String REF = "CrossPlant";
	public static String PROP_RESULT_ID = "ResultId";
	public static String PROP_PLANT_ID1 = "PlantId1";
	public static String PROP_ID = "Id";
	public static String PROP_SUCCESS_RATE = "SuccessRate";
	public static String PROP_PLANT_ID2 = "PlantId2";


	// constructors
	public BaseCrossPlant () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseCrossPlant (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseCrossPlant (
		java.lang.Integer id,
		java.lang.Integer plantId1,
		java.lang.Integer plantId2,
		java.lang.Integer resultId,
		java.lang.Integer successRate) {

		this.setId(id);
		this.setPlantId1(plantId1);
		this.setPlantId2(plantId2);
		this.setResultId(resultId);
		this.setSuccessRate(successRate);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer plantId1;
	private java.lang.Integer plantId2;
	private java.lang.Integer resultId;
	private java.lang.Integer successRate;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: plant_id_1
	 */
	public java.lang.Integer getPlantId1 () {
		return plantId1;
	}

	/**
	 * Set the value related to the column: plant_id_1
	 * @param plantId1 the plant_id_1 value
	 */
	public void setPlantId1 (java.lang.Integer plantId1) {
		this.plantId1 = plantId1;
	}



	/**
	 * Return the value associated with the column: plant_id_2
	 */
	public java.lang.Integer getPlantId2 () {
		return plantId2;
	}

	/**
	 * Set the value related to the column: plant_id_2
	 * @param plantId2 the plant_id_2 value
	 */
	public void setPlantId2 (java.lang.Integer plantId2) {
		this.plantId2 = plantId2;
	}



	/**
	 * Return the value associated with the column: result_id
	 */
	public java.lang.Integer getResultId () {
		return resultId;
	}

	/**
	 * Set the value related to the column: result_id
	 * @param resultId the result_id value
	 */
	public void setResultId (java.lang.Integer resultId) {
		this.resultId = resultId;
	}



	/**
	 * Return the value associated with the column: success_rate
	 */
	public java.lang.Integer getSuccessRate () {
		return successRate;
	}

	/**
	 * Set the value related to the column: success_rate
	 * @param successRate the success_rate value
	 */
	public void setSuccessRate (java.lang.Integer successRate) {
		this.successRate = successRate;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.CrossPlant)) return false;
		else {
			com.chee.plant.hibernate.object.CrossPlant crossPlant = (com.chee.plant.hibernate.object.CrossPlant) obj;
			if (null == this.getId() || null == crossPlant.getId()) return false;
			else return (this.getId().equals(crossPlant.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

private static final long serialVersionUID = 1L; 
}